const vFocus = {
  name: 'focus',
  mounted: (el, binding) => {
    if (binding.value !== 1) {
      if (el.tagName === 'INPUT') {
        el.focus()
      } else {
        const input = el.getElementsByTagName('input')
        if (input) {
          input[0].focus()
        }
      }
    }
  },
}

export default vFocus
